home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13209 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  4.8 KB

  1. Path: in2.uu.net!interaccess!usenet
  2. From: "Thaddeus L. Olczyk" <Polczyk@interaccess.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: C++ vs Delphi 2.0
  5. Date: 24 Mar 1996 07:40:40 GMT
  6. Organization: InterAccess, Chicagoland's Full-Service Internet Provider
  7. Message-ID: <4j2u9o$s0n@nntp.interaccess.com>
  8. References: <825673272.2083@axiombc.demon.co.uk> <4hmop6$snh@cdshub.cdc.com> <4ims71$oh3@hawk.pix.za> <3152304b.5915048@news.newcastle.edu.au>
  9. NNTP-Posting-Host: d120.nwchi.interaccess.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22KIT (Windows; U; 16bit)
  14.  
  15. mazz@faceng.newcastle.edu.au (Richard Mazzaferri) wrote:
  16.  
  17. > somebody wrote :
  18. >> >>What about Class Libraries, can we use C++ libraries in Delphi?
  19. >
  20.  
  21. >As long as you encapsulate them in a DLL with a straight C interface - this
  22. >can be annoying, and can lead to programming errors because you tend to
  23. >pass generic pointers and lose some type checking.
  24. More importantly you can only pass functions and variables to a dll.
  25. The class structure of your code will be completely lost.
  26.  
  27. >> The problem with Delphi is that most people don't seem to realise that
  28. >> true programming power\flexibility and ease of use are generally
  29. >> mutually exclusive. Delphi is in Pascal ... which is fundamentally a
  30. >> teaching language and was never meant as anything more. C++ .exe's
  31. >> tend to be smaller and faster than Delphi .exe's. Although C++ has no
  32. >> real standard, it's getting there and it is younger than Pascal.
  33. >> Pascal tries to be English-like and this it has become pretty rigid.
  34. >> (This is a personal opinion) to fit smoothly ith OOP. Additionally, if
  35. >> you use Delphi, you'll find that the general feel of it discourages
  36. >> one from using code, and directly controlling things. This can't be
  37. >> good! 
  38. >
  39. >Have you spent much time using Delphi, say more than ten minutes?  Delphi
  40. >is NOT in Pascal - that statement is like saying that C++ is in C.  Delphi
  41. >is in Object Pascal which is *derived* from Pascal, just like C++ is
  42. >derived from C.  I think you'll find that many creations find uses in the
  43. >real world beyond the intent of the original author, and that Delphi is not
  44. >particularly rigid - just uses different syntax and type checking.
  45. >Delphi's OO is in some ways better than C++ and in other ways not as good.
  46.  
  47. I have argued in the past and continue to argue now that it is a misnomer
  48. to call Delphi OO. It partial emulates the C++/Eiffel model of static 
  49. typing, but misses severely by what it keeps out. It partially emulates
  50. the Smalltalk model of dynamic typing, but in a convoluted way.
  51.  
  52. >The biggest omissions are multiple inheritance (which can generally be
  53. >faked with a bit of work) and templates (no workaround :-(.  Some of the
  54.  
  55. Many times a lot of work or virtually impossible. 
  56.  
  57. >big wins are properties and really good exception handling and RTTI.  I
  58. >also find that I generate far fewer bugs in Delphi than I did in C++,
  59. >probably to do with the type checking.
  60.  
  61. Or more to do with the fact that you probably wrote C code in C++.
  62. If you read D&E strong typing is one of the corner stones of C++. I use
  63. it all the time.
  64.  
  65. As for you qualities.
  66. Properties -- A feature of any dll/vbx type architecture. Affects most 
  67. programming very little ( at the cost of some overhead too ).
  68.  
  69. Exception handling -- a feature of both Delphi and C++ and is used the 
  70. same way in both. Except for one exception, Delphi's model of 
  71. explicitly constructing and destructing objects means that a lot more 
  72. effort is expended to make sure resources are freed ( nested finally 
  73. blocks) .
  74.  
  75. As for RTTI, it is similar to C++ RTTI , but I believe the 
  76. standards committee considers it a nessecsary evil, because programmers 
  77. can do it themselves quite easily. It is a bad practice
  78. because it hurts strong type checking. Unfortunately in Delphi 
  79. you have to revert to it often because of the poor object model.
  80.  
  81. I would say that Delphi is a tool usefull for single programmers, or
  82. for a small team working on a small (less then three month long ) project.
  83.  
  84. >
  85. >I don't understand why it "..discourages one from using code...".  I
  86.  
  87. One of the major selling points of Delphi I hear from most Delphi
  88. programmers is "isn't it great I can write this application with
  89. virtually no code".
  90.  
  91.  
  92. >certainly don't get that feeling.  I've been a long time C++ programmer,
  93. >and the first couple of days with Delphi felt quite strange, because I
  94. >didn't have the broad knowledge of the entire system that I had with
  95. >various C++ compilers.  After that, it was *very* pleasant and *very*
  96. >productive.  The EXEs tend to suffer from the first couple of hundred of kB
  97. >of run time library (which is not a big worry in most cases these days),
  98. >but they are not particularly slow in my experience.
  99. >
  100. >Each to his own :-)
  101. >
  102. >Have fun,
  103. >    Mazz.
  104. >mazz@faceng.newcastle.edu.au
  105.  
  106.  
  107.